<script setup lang="ts">
defineProps<{
  loading: boolean
  checked: boolean
}>()
const emit = defineEmits<{
  (event: 'update:checked', checked: boolean): void
}>()

const handleToggleCheck = (checked: boolean) => {
  emit('update:checked', checked)
}
</script>

<template>
  <i
    :class="[
      'layers__item__check',
      checked && 'layers__item__check--checked',
      loading && 'layers__item__check--loading'
    ]"
    @click="handleToggleCheck(!checked)"
  ></i>
</template>
